/*--------------------------+
|	   EmitterManager		|
|	---------------------	|
|	Contains, updates and	|
|	renders emitters, also	|
|	managing their memory	|
+--------------------------*/

#pragma once

#include <vector>

class Emitter;

class EmitterManager
{

private:

	EmitterManager(void);
	~EmitterManager(void);

	// Active emitters
	std::vector<Emitter*> Emitters;

	// Single burst emitters
	std::vector<Emitter*> Bursts;

	// Emitters that can be cloned
	std::vector<Emitter*> MasterEmitters;

public:

	// Get the singleton
	static EmitterManager* GetInstance(void);

	// Create a template emitter
	int CreateEmitterTemplate(Emitter* emitter);

	// Clone a template
	Emitter* CreateEmitterFromTemplate(int id);

	// Fire a single burst with an emitter then destroy it
	void FireBurstEmitter(Emitter* emitter);

	// Render all the emitters
	void Render(void) const;

	// Update all the emitters
	void Update(float elapsedTime);

	// Remove a specific template
	void DestroyTemplate(unsigned int index);

	// Close the system down
	void Shutdown(void);

};

